﻿package se.penselnsvag.bookdb.tech.log{


public class LogMessage
{
	
	public function LogMessage(logMessage:String,logClassName:String,logMethodName:String,logException:Error)
	{
		this.logMessage = logMessage;
		this.logException = logException;
		this.logTimestamp = new Date();
		this.logClassName = logClassName;
		this.logMethodName = logMethodName;
	}
	
	private var logClassName:String; 
	private var logMethodName:String;
	private var logMessage:String;
	private var logException:Error;
	private var logTimestamp:Date;
	private var logLevel:Number;
	private var logLevelName:String;
	
	/**
	* getLogLevel()
	*
	* @return Number
	*/
	public function getLogLevel() : Number
	{
		return this.logLevel;
	}
	
	/**
	* setLogLevel()
	*
	* @param Number
	*/
	public function setLogLevel(logLevel:Number) : void
	{
		this.logLevel = logLevel;
		setLogLevelName(LogManager.getLogLevelName(logLevel));
	}
	
	/**
	* setLogLevelName()
	*
	* @param logLevelName.
	*/
	private function setLogLevelName(logLevelName:String) : void
	{
		this.logLevelName = logLevelName;
	}
	
	/**
	* getLogMessage()
	*
	* @return String
	*/
	public function getLogMessage() : String
	{
		return this.logMessage;
	}
	
	/**
	* getLogException()
	*
	* @return Error
	*/
	public function getLogException() : Error
	{
		return this.logException;
	}
	
	/**
	* getLogTimeStamp()
	*
	* @return Date
	*/
	public function getLogTimeStamp() : Date
	{
		return this.logTimestamp;
	}
	
	public function getLogClassName(): String 
	{
		return this.logClassName;
	}
	
	public function getLogMethodName() : String
	{
		return this.logMethodName;
	}
	
	public function getLogLevelName() : String
	{
		return this.logLevelName;
	}
	
	public function toString(): String {
		return logMessage;
	}
}
}